import { Settings as LayoutSettings } from "@ant-design/pro-layout";

const isDev = process.env.NODE_ENV === "development";
export const apiUrl = isDev
  ? "http://localhost:81/" // 调试
  : "http://192.168.6.4:81/"; // 发布
export const isLight = () => {
  const hour = new Date().getHours();
  return hour >= 7 && hour < 19;
};
/**
 * 容器背景色
 */
export const backgroundColor = isLight() ? "unset" : "black";
/**
 * 文字颜色
 */
export const color = isLight() ? "unset" : "white";

const Settings: Partial<LayoutSettings> & {
  pwa: boolean;
  siderWidth: number;
} = {
  title: "瓶子管理",
  navTheme: isLight() ? "light" : "realDark",
  layout: "mix",
  contentWidth: "Fluid",
  fixedHeader: true,
  fixSiderbar: true,
  colorPrimary: "#1890ff",
  splitMenus: false,
  siderMenuType: "sub",

  siderWidth: 180,
  menu: { locale: false }, // 不需要菜单国际化
  pwa: false,
};

export default Settings;
